linux: Fix swiotlb bug-out due to uninitialised end_pfn/max_mapnr.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 20 Feb 2007 12:27:03 +0000 (12:27 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 20 Feb 2007 12:27:03 +0000 (12:27 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h
linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h

index 1d345898cc5ec750f0dc4605800d4a510f9f081c..8f3b7d8298b95318e218c7abcc71864f46965a12 100644 (file)
@@ -103,7 +103,7 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
 
 static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 {
-       BUG_ON(pfn >= max_mapnr);
+       BUG_ON(max_mapnr && pfn >= max_mapnr);
        if (xen_feature(XENFEAT_auto_translated_physmap)) {
                BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
                return;
index 249b95965f91f83c3cd369a1f02755296f321dd0..2bbac7cb4e811b45518af92748c7784bd541603d 100644 (file)
@@ -97,7 +97,7 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
 
 static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 {
-       BUG_ON(pfn >= end_pfn);
+       BUG_ON(end_pfn && pfn >= end_pfn);
        if (xen_feature(XENFEAT_auto_translated_physmap)) {
                BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
                return;